import { faker } from "@faker-js/faker";
// @ts-expect-error defineFakeRoute
import { defineFakeRoute } from "vite-plugin-fake-server/client";

export default defineFakeRoute([
  {
    url: "/rightPageData",
    method: "post",
    response: () => {
      return {
        code: 200,
        message: "success",
        data: {
          browseCategories: {
            data: [
              faker.number.float({ min: 1, max: 1000 }).toFixed(2),
              faker.number.float({ min: 1, max: 1000 }).toFixed(2),
              faker.number.float({ min: 1, max: 1000 }).toFixed(2),
              faker.number.float({ min: 1, max: 1000 }).toFixed(2),
              faker.number.float({ min: 1, max: 1000 }).toFixed(2),
              faker.number.float({ min: 1, max: 1000 }).toFixed(2)
            ],
            indicator: [
              {
                name: "食物",
                max: 1000
              },
              {
                name: "娱乐",
                max: 1000
              },
              {
                name: "运动",
                max: 1000
              },
              {
                name: "家居",
                max: 1000
              },
              {
                name: "机械",
                max: 1000
              },
              {
                name: "学习",
                max: 1000
              }
            ]
          },
          userIdentityCategory: {
            data: [
              {
                id: 1,
                name: "公务",
                value: faker.number.int({ min: 10, max: 1000 })
              },
              {
                id: 2,
                name: "学生",
                value: faker.number.int({ min: 10, max: 1000 })
              },
              {
                id: 3,
                name: "教师",
                value: faker.number.int({ min: 10, max: 1000 })
              },
              {
                id: 4,
                name: "军区",
                value: faker.number.int({ min: 10, max: 1000 })
              },
              {
                id: 5,
                name: "企业",
                value: faker.number.int({ min: 10, max: 1000 })
              }
            ]
          },
          offline: {
            feedback: [
              {
                id: 1,
                title: "服务质量",
                number: faker.number.int({ min: 1, max: 100 })
              },
              {
                id: 2,
                title: "交互体验",
                number: faker.number.int({ min: 1, max: 100 })
              },
              {
                id: 3,
                title: "安全防护",
                number: faker.number.int({ min: 1, max: 100 })
              }
            ],
            offlinePortal: {
              data1: [
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 })
              ],
              data2: [
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 })
              ],
              data3: [
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 })
              ],
              data4: [
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 }),
                faker.number.int({ min: 1, max: 1000 })
              ],
              xData: ["9:00", "12:00", "15:00", "18:00", "21:00", "00:00"],
              barData: [
                faker.number.float({ min: 1, max: 100 }).toFixed(2),
                faker.number.float({ min: 1, max: 100 }).toFixed(2),
                faker.number.float({ min: 1, max: 100 }).toFixed(2),
                faker.number.float({ min: 1, max: 100 }).toFixed(2),
                faker.number.float({ min: 1, max: 100 }).toFixed(2),
                faker.number.float({ min: 1, max: 100 }).toFixed(2)
              ]
            }
          }
        }
      };
    }
  }
]);
